package com.modifymetrodemo.utils;

import android.util.Log;

public class TimeRecordUtils {

    private static final String TAG = "TimeRecordUtils";

    private static long sStartTime;
    private static long sEndTime;

    public static void setStartTime() {
        sStartTime = System.currentTimeMillis();
    }

    public static void setEndTime() {
        sEndTime = System.currentTimeMillis();
    }

    public static long getTimeCost() {
        return sEndTime - sStartTime;
    }

    public static void printTimeInfo() {
        Log.d(TAG, "----------------------------------");
        Log.d(TAG, "| Start Time (ms): " + sStartTime);
        Log.d(TAG, "| End Time (ms): " + sEndTime);
        Log.d(TAG, "| Time cost (ms): " + getTimeCost());
        Log.d(TAG, "----------------------------------");
    }

}
